﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

namespace Royaume
{
    public class Connect
    {
        public Connect() { }

       public SqlConnection myCn;
        SqlCommand myCmd;
        public void connectiongameIf() 
        {
            if (this.myCn == null)
            {
                this.myCn = new SqlConnection(
            "Data Source=(local);Initial Catalog=DB_GAME;User Id=RoyaumesLibres;Password=123456;");
                this.myCn.Open();
            }
        }
        public void connectionuserIf()
        {
            if (this.myCn == null)
            {
                this.myCn = new SqlConnection(
            "Data Source=(local);Initial Catalog=DB_USERS;User Id=RoyaumesLibres;Password=123456;");
                this.myCn.Open();
            }
        }

        public void connectionClose(){
            if (this.myCn != null)
            {
                this.myCn.Close();
            }
        }
        public static SqlConnection getconnectionstringG()
        {
            return new SqlConnection("Data Source=(local);Initial Catalog=DB_GAME;User Id=RoyaumesLibres;Password=123456");
        }
                public static SqlConnection getconnectionstringU()
        {
            return new SqlConnection("Data Source=(local);Initial Catalog=DB_USERS;User Id=RoyaumesLibres;Password=123456;");
        }
    }
}